home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 57131 / 57131.xpi / chrome / beefree.jar / content / beefree / w / bf.w.bing.js < prev    next >
Encoding:
JavaScript  |  2010-01-25  |  2.7 KB  |  82 lines

  1. /*
  2.     2009 - Copyright by Bee <http://www.honeybeenet.altervista.org>.
  3.     This program is free software; you can redistribute it and/or
  4.     modify it under the terms of the GNU General Public License
  5.     as published by the Free Software Foundation; either version 2
  6.     of the License, or (at your option) any later version.
  7.  
  8.     This program is distributed in the hope that it will be useful,
  9.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.     GNU General Public License for more details.
  12.  
  13.     You should have received a copy of the GNU General Public License
  14.     along with this program; if not, write to the Free Software
  15.     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. */
  17.  
  18. function beefree_w_bing_domain(selfIndex, stack)
  19. {
  20.     //case insensitive (gmi)
  21.     var address = stack["address"];
  22.     var regexp = /(\/\/|\.)bing\.com\//gmi;
  23.     return beefree_regexp_test(address, regexp);
  24. }
  25.  
  26. function beefree_w_bing_host(selfIndex, stack)
  27. {
  28.     var hostname = stack["hostname"];
  29.     var regexp = /bing\.com/gmi;
  30.     return beefree_regexp_test(hostname, regexp);
  31. }
  32.  
  33. function beefree_w_bing_replace(selfIndex, stack)
  34. {
  35.     var address = stack["address"];
  36.     var current_page = stack["current_page"];
  37.     return address;
  38. }
  39.  
  40. function beefree_w_bing_accept(selfIndex, stack)
  41. {
  42.     var address = stack["address"];
  43.     var current_page = stack["current_page"];
  44.     return beefree_is_hyperlink(address) && 
  45.             !beefree_is_protocol(address, "javascript:") &&
  46.             !beefree_is_anchor_magic(address, current_page) &&
  47.             !beefree_is_anchor(address);
  48. }
  49.  
  50. function beefree_w_bing_confirm(selfIndex, stack)
  51. {
  52.     var address = stack["address"];
  53.     var address_original = stack["address_original"];
  54.     var current_page = stack["current_page"];
  55.     return !((beefree_website_get(selfIndex)["test.domain"])(selfIndex, stack)) || address != address_original ||
  56.             beefree_host_from_address(address) != beefree_host_from_address(current_page);
  57. }
  58.  
  59.  
  60.  
  61. (function(){
  62.     var data = new Array();
  63.     data["enabled"] = true;
  64.     data["system"] = true;
  65.     data["version"] = 1;
  66.     data["name"] = "Bing";
  67.     data["test.host"] = beefree_w_bing_host;
  68.     data["test.domain"] = beefree_w_bing_domain;
  69.     data["referer.remove"] = true;
  70.     data["useragent.remove"] = true;
  71.     data["links.remove"] = true;
  72.     data["links.recursion"] = true;
  73.     data["links.metaengine"] = false;
  74.     data["links.onload"] = true;
  75.     data["links.ignoredomain"] = false;
  76.     data["links.function.accept"] = beefree_w_bing_accept;
  77.     data["links.function.replace"] = beefree_w_bing_replace;
  78.     data["links.function.confirm"] = beefree_w_bing_confirm;
  79.     beefree_h_script_add(data);
  80. })();
  81.  
  82.